import Vue from 'vue'
import VueRouter from 'vue-router'
//import HomeView from '../views/WeCome.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/index',
    name: 'index',
    redirect: "/WeCome",
    component: () => import("../views/IndexView.vue"),
    children: [
      {
        path: '/WeCome',
        name: 'WeCome',
        component: () => import('../views/WeCome.vue')
      },
      {
        path: '/LoginView',
        name: 'LoginView',
        component: () => import('../views/LoginView.vue')
      },
      {
        path: '/RegisterView',
        name: 'RegisterView',
        component: () => import('../views/RegisterView.vue')
      },
      {
        path: '/AdminList',
        name: 'AdminList',
        component: () => import('../views/Admin/AdminList.vue')
      },
      {
        path: '/AddAdmin',
        name: 'AddAdmin',
        component: () => import('../views/Admin/AddAdmin.vue')
      },
      {
        path: '/MenuList',
        name: 'MenuList',
        component: () => import('../views/Menu/MenuList.vue')
      },
      {
        path: '/AddMenu',
        name: 'AddMenu',
        component: () => import('../views/Menu/AddMenu.vue')
      },
      // {
      //   path: '/UpdMenu',
      //   name: 'UpdMenu',
      //   component: () => import('../views/Menu/UpdMenu.vue')
      // },
      // {
      //   path: '/EditMenu',
      //   name: 'EditMenu',
      //   component: () => import('../views/Menu/EditMenu.vue')
      // },
      {
        path: '/RoleList',
        name: 'RoleList',
        component: () => import('../views/Role/RoleList.vue')
      },
      {
        path: '/AddRole',
        name: 'AddRole',
        component: () => import('../views/Role/AddRole.vue')
      },
      {
        path: '/EditRole',
        name: 'EditRole',
        component: () => import('../views/Role/EditRole.vue')
      },
      {
        path: '/ErrorView',
        name: 'ErrorView',
        component: () => import('../views/ErrorView.vue')
      },
      { path: '*', redirect: '/ErrorView', hidden: true }

    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
